package com.java.androidmarket.service.impl;

import com.java.androidmarket.dao.AddressDao;
import com.java.androidmarket.entity.Address;
import com.java.androidmarket.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * description:
 * author:张腾
 * date:2021-05-08
 */
@Service
public class AddressServiceImpl implements AddressService {

    @Autowired
    AddressDao addressDao;

    @Override
    public List<Address> getAddress(int userId) {
        return addressDao.getAddress(userId);
    }

    @Override
    public Address getDefaultAdd(int userId) {
        return addressDao.getDefaultAdd(userId);
    }

    @Override
    public void newAdd(Address address) {
        addressDao.newAdd(address);
    }

    @Override
    public void updateAdd(Address address) {
        addressDao.updateAdd(address);
    }

    @Override
    public void deleteAdd(int addressId) {
        addressDao.deleteAdd(addressId);
    }

    @Override
    public int getUserId(int addressId) {
        return addressDao.getUserId(addressId);
    }

    @Override
    public void updateState(int addressId, int state) {
        addressDao.updateState(addressId,state);
    }
}
